<?php
define('SCR','nbc_index');
$nbcId = intval($_POST['userid']);
$nbcPwd = trim($_POST['userpwd']);

require_once('global.php');
unset($_GET,$_POST,$_REQUEST);


if (!empty($nbcId) && !empty($nbcPwd)) {
	$userInfo = $db->get_one("SELECT uid,username,password,groupid,ifadmin FROM cms_user WHERE nbcid='$nbcId'");
	if ($userInfo['password'] == md5($nbcPwd)) {
		Cookie('login', $userInfo['username'] . "\t" . $userInfo['password'], 'F');
		$login = $userInfo;
		$login_name = $userInfo['username'];
	} else {
		start();
		exit('用户名密码不同步，无法登录。' . $nbcId . '|' . $nbcPwd);
	}
} else {
	start();
	exit('客户端没有正确传递用户名和密码信息，请联系管理人员。');
}

require_once(R_P . 'require/init.php');
require_once(R_P.'require/class_cms.php');
$cms = new Cms();

start();
//print_r($_COOKIE);
require Template();
footer();
?>